<template>
  <view class="container">
    <!-- 用户信息区域 -->
    <view class="userList">
      <navigator url="../user/info" class="userLine">
        <view class="userLine">
          <image :src="mephoto" class="userLogo" mode="aspectFit"></image>
          <view class="user-info">
            <view class="username">{{ teachername }}</view>
            <view class="user-id">ID: {{ teacherdataid }}</view>
          </view>
        </view>
        <uni-icons type="arrowright" size="20" color="#999"></uni-icons>
      </navigator>
    </view>

    <!-- 采购订单标题区域 -->
    <view class="order-section">
      <view class="order-title">
        <text>采购订单</text>
        <navigator url="./order/order-list" class="all-orders">
          全部订单
          <uni-icons type="arrowright" size="14" color="#999"></uni-icons>
        </navigator>
      </view>
      <view class="order-items">
        <view class="order-item" @click="navTo('/pages/order/order-list?type=1')">
          <view class="icon-wrap">
            <uni-icons type="wallet" size="30" color="#ff7f00"></uni-icons>
          </view>
          <text>待付款</text>
        </view>
        <view class="order-item" @click="navTo('/pages/order/order-list?type=2')">
          <view class="icon-wrap">
            <uni-icons type="time" size="30" color="#ff7f00"></uni-icons>
          </view>
          <text>待发货</text>
        </view>
        <view class="order-item" @click="navTo('/pages/order/order-list?type=3')">
          <view class="icon-wrap">
            <uni-icons type="car" size="30" color="#ff7f00"></uni-icons>
          </view>
          <text>待收货</text>
        </view>
        <view class="order-item" @click="navTo('/pages/order/order-list?type=4')">
          <view class="icon-wrap">
            <uni-icons type="checkbox" size="30" color="#ff7f00"></uni-icons>
          </view>
          <text>已完成</text>
        </view>
      </view>
    </view>

    <!-- 收货地址区域 -->
    <view class="address-section">
      <navigator url="./address/address" class="address-item">
        <view class="left">
          <uni-icons type="location" size="20" color="#ff7f00"></uni-icons>
          <text>收货地址</text>
        </view>
        <uni-icons type="arrowright" size="20" color="#999"></uni-icons>
      </navigator>
    </view>

    <!-- 空白区域 -->
    <view class="blank"></view>
  </view>
</template>

<script>
export default {
  methods: {
    navigateToProfile() {
      uni.navigateTo({
        url: '/pages/profile/profile'
      });
    },
    navigateToAddress() {
      uni.navigateTo({
        url: '/pages/address/address'
      });
    }
  }
}
</script>

<style scoped>
.container {
  background-color: #fff;
}

.userLogo {
  width: 120rpx;
  height: 120rpx;
  border-radius: 50%;
}

.user-info {
  margin-left: 30rpx;
}

.username {
  font-size: 34rpx;
  font-weight: 500;
}

.user-id {
  color: #888;
  font-size: 28rpx;
  margin-top: 6rpx;
}

.order-section {
  margin: 20rpx;
  background: #fff;
  border-radius: 12rpx;
  padding: 30rpx 0;
}

.order-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30rpx;
  margin-bottom: 30rpx;
}

.all-orders {
  font-size: 26rpx;
  color: #999;
  display: flex;
  align-items: center;
}

.order-items {
  display: flex;
  justify-content: space-around;
}

.order-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.order-item text {
  font-size: 26rpx;
  color: #333;
  margin-top: 10rpx;
}

.address-section {
  margin: 20rpx;
  background: #fff;
  border-radius: 12rpx;
}

.address-item {
  padding: 30rpx;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.left {
  display: flex;
  align-items: center;
  gap: 20rpx;
}

.blank {
  height: 200rpx;
}
</style>